package com.theta.gateway.infra.common.enums;


import lombok.Getter;


@Getter
public enum SsoValidateTypeEnum {
	
	NOT_VALIDATE(0, "不校验登陆认证",""),
	TENANT(1, "租户管理端","SsoTenantAuthentication"),
	USER(2, "用户端","SsoUserAuthentication"),

   

   ;

   private Integer code;
   private String name;
   private String filterName;

   SsoValidateTypeEnum(Integer code, String name,String filterName) {
       this.code = code;
       this.name = name;
       this.filterName=filterName;
   }

   /**
    * 根据状态码获取对应枚举
    * @param SsoValidateTypeEnum 状态码
    * @return 对应枚举。没有则返回Null
    */
   public static SsoValidateTypeEnum getByCode(Integer code) {
       if (code==null) {
           return null;
       }
       for (SsoValidateTypeEnum e : SsoValidateTypeEnum.values()) {
           if (e.code.intValue()==code.intValue()) {
               return e;
           }
       }
       return null;
   }

}
